﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using iSufeMVC4.WebAPI.Models;

namespace iSufeMVC4.WebAPI.Controllers
{
    public class PartyController : ApiController
    {
        public ResultList<Party> List(UserDatetimeQuery query)
        {
            Party c1 = new Party()
            {
                partyId = 1,
                name = "活动1",
                address = "财大食堂",
                speaker = "学生会",
                num = 10,
                joinNum = 12,
                status = 1
            };
            Party c2 = new Party()
            {
                partyId = 2,
                name = "活动2",
                address = "财大食堂",
                speaker = "学生会",
                num = 10,
                joinNum = 12,
                status = 1
            };
            List<Party> cc = new List<Party>();
            cc.Add(c1);
            cc.Add(c2);
            ResultList<Party> results = new ResultList<Party>()
            {
                startIndex = 0,
                isEnd = false,
                list = cc,
                nextStartIndex = 2
            };
            return results;
        }

        [HttpPost]
        public string Add(Party party)
        {
            return "SuccessMsg!";
        }
    }
}
